/**
 * 弹簧道具
 */
cc.Class({
    extends: cc.Component,

    properties: {

    },

    onLoad() {
        
     },
    // 只在两个碰撞体开始接触时被调用一次
    onBeginContact: function (contact, selfCollider, otherCollider) {
        this.player = otherCollider.node.getComponent("Player");
        this.animation = otherCollider.node.getComponent(cc.Animation)
        //播放动画和给一个向上的线速度
        selfCollider.node.getComponent(cc.Animation).play("jumpPlatForm");
        if (selfCollider.tag === cc.vv.TAG.SPRINGUP) {
            this.player.initPrivateData();
            this.player.initListener();
            cc.vv.isHeroDie = false;
            otherCollider.node.prop = 'Jump';
            this.animation.stop();
            this.animation.play("heroJump");
            //火箭监听
            let rocket = otherCollider.node.parent.getChildByName("prop").getChildByName("rocket_prop");
            rocket.getComponent(cc.RigidBody).enabledContactListener = true;
            this.player.copyCrash();
            otherCollider.node.getComponent(cc.RigidBody)._b2Body.m_linearVelocity.y = 23;
        }
    },

    
    // start () {},

    // update (dt) {},
});
